/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package test;

import com.sun.jersey.api.client.Client;
import entity.Board;
import entity.Post;
import java.io.IOException;

/**
 *
 * @author Wink
 */
public class test {
    
    static String host = "http://localhost:8080";//http://doghead.ca:9000";
    
    
    
    public static void main (String [] args) throws IOException {
        Client client = new Client();
        boardtest(client);
    }
    
    public static void usertest(Client client) throws IOException {
        String url = host + "/HashArea-war/rest/users";
        
        UserTest ut = new UserTest(client, "bob", url);
        
        ut.post();
    }
    
    public static void posttest(Client client) throws IOException {
        String url = host + "/HashArea-war/rest/posts";
        double bd = 0;
        Post post = new Post(0, "Hello", "tester", bd, bd);
        
        PostTest pt = new PostTest(client, post, url, "0");
        
        pt.get();
        pt.post();
        pt.get();
        pt.post.setText("Hello World!");
        pt.put();
        pt.get();
        //pt.delete();
        pt.get();
    }
    
    public static void boardtest(Client client) throws IOException {
        String url = "http://localhost:8080/HashArea-war/rest/boards";
        double z = 0;
        double n = 1;
        double w = -1;
        double s = -1;
        double e = 1;
        Board b = new Board("Zero", n, w, s, e, 1);
        BoardTest bt = new BoardTest(client, b, url);
        
        bt.post();
        bt.get("0", "0");
        //bt.delete();
    }
}
